import Vue from 'vue'
import Router from 'vue-router'
import HomeRec from '@/components/home/HomeRec'
import hot from '@/components/home/hot'
import search from '@/components/home/search'
import player from '@/components/play/player'
import download from '@/components/download/download'

Vue.use(Router)

// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
export default new Router({
  routes: [
    {
      path: '/home/HomeRec',
      name: 'HomeRec',
      component: HomeRec
    },
    {
      path: '/home/hot',
      name: 'hot',
      component: hot
    },
    {
      path: '/home/search',
      name: 'search',
      component: search
    },
    {
      path: '/play/player',
      name: 'player',
      component: player
    },
    {
      path: '/download/download',
      name: 'download',
      component: download
    },
    
  ]
})
